package com.api.shopapi.service.impl;

import com.api.shopapi.entity.ShopPageData;
import com.api.shopapi.entity.dto.ElderlyViewsDTO;
import com.api.shopapi.mapper.ViewsMapper;
import com.api.shopapi.service.ViewsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ViewsServiceImplOne")
public class ViewsServiceImpl implements ViewsService {

    @Autowired
    private ViewsMapper viewsMapper;

    @Override
    public ShopPageData getElderly(String governmentCode) {
        return viewsMapper.getElderly(governmentCode);
    }

    @Override
    public ShopPageData getElderlyByNew(String governmentCode) {
        return viewsMapper.getElderlyByNew(governmentCode);
    }

    @Override
    public ShopPageData getElderlyTotal(String governmentCode) {
        return viewsMapper.getElderlyTotal(governmentCode);
    }

    @Override
    public int getElderlyCount(String governmentCode) {
        return viewsMapper.getElderlyCount(governmentCode);
    }

    @Override
    public int getGovernmentOrderCount(String governmentCode) {
        return viewsMapper.getGovernmentOrderCount(governmentCode);
    }

    @Override
    public int getTotalBuildNew(String governmentCode) {
        return viewsMapper.getTotalBuildNew(governmentCode);
    }

    @Override
    public int getTotalAcceptNew(String governmentCode) {
        return viewsMapper.getTotalAcceptNew(governmentCode);
    }

    @Override
    public int getTotalServeNew(String governmentCode) {
        return viewsMapper.getTotalServeNew(governmentCode);
    }

    @Override
    public int getTotalSuccessNew(String governmentCode) {
        return viewsMapper.getGovernmentOrderCount(governmentCode);
    }

    @Override
    public int getTotalServiceObjectNew(String governmentCode) {
        return viewsMapper.getTotalServiceObjectNew(governmentCode);
    }

    @Override
    public int getTotalBusinessNew(String governmentCode) {
        return viewsMapper.getTotalBusinessNew(governmentCode);
    }

    @Override
    public int getTotalServicePeopleNew(String governmentCode) {
        return viewsMapper.getTotalServicePeopleNew(governmentCode);
    }

    @Override
    public int getWomanService(String governmentCode) {
        return viewsMapper.getWomanService(governmentCode);
    }

    @Override
    public int getManServic(String governmentCode) {
        return viewsMapper.getManService(governmentCode);
    }

    @Override
    public int getTotalServiceNews(String governmentCode) {
        return viewsMapper.getTotalServiceNews(governmentCode);
    }

    @Override
    public int getClassOneNews(String governmentCode) {
        return viewsMapper.getClassOneNews(governmentCode);
    }

    @Override
    public int getClassTwoNews(String governmentCode) {
        return viewsMapper.getClassTwoNews(governmentCode);
    }

    @Override
    public int getClassThreeNews(String governmentCode) {
        return viewsMapper.getClassThreeNews(governmentCode);
    }

    @Override
    public PageInfo<ElderlyViewsDTO> getList(int pageIndex, int pageSize,List<String> governmentCodeList) {
        PageHelper.startPage(pageIndex,pageSize);
        List<ElderlyViewsDTO> elderlyDTOList=viewsMapper.getList(governmentCodeList);
        return new PageInfo<>(elderlyDTOList);
    }
}
